template.helper('formatPrice', function (s) {
    var n = 2;
    s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(n) + '';
    var l = s.split('.')[0].split('').reverse(),
        r = s.split('.')[1];
    var t = '';
    for (var i = 0; i < l.length; i++) {
        t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? ',' : '');
    }
    return t.split('').reverse().join('') + '.' + r;
});
template.helper('formatDate1', function (s) {
    return moment(s).format('YYYY/MM/DD');
});
template.helper('formatDate2', function (s) {
    return moment(s).format('HH:mm:ss');
});
template.helper('formatDate3', function (s) {
    return moment(s).format('YYYY/MM/DD HH:mm:ss');
});
template.helper('toPercent', function (s) {
	return (Math.round(s * 10000)/100).toFixed(2) + '%';
});